home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1990 June / 1990-06.d64 / bas_beg 1 (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  988b  |  29 lines

  1. 10 poke 53280,0:poke 53281,0:print chr$(147):bt=100:fl=1:i=1:l=39
  2. 20 rn=rnd(-ti/101)
  3. 30 c$=chr$(18)+chr$(160)
  4. 40 input "how many bars (max. 15)";nb:if nb<1 or nb>15 then print"[145][145][145]":goto40
  5. 50 print "[147]press space bar when you see something."
  6. 60 print "number at end of bar is reaction time":print "in seconds. ";
  7. 70 if gl=0 then gl=1:print "press space bar to start.";:goto 90
  8. 80 print "press space bar to start again."
  9. 90 get a$:if a$<>" " then 90
  10. 100 print chr$(147):for u=1 to int(800*rnd(1))+30:next:poke 198,0:print "";
  11. 110 print c$;:ti$="000000"
  12. 120 k=k+i:get a$:if a$<>" " then print c$;:if k<l then 120
  13. 130 if k=l then k=0:print:print "too late!":goto 230
  14. 140 j=ti:k=0
  15. 150 j=j/60:j=int(j*100+.5)/100:print j;:print
  16. 160 if peek(197)=60 then 160
  17. 170 poke 198,0:tl=tl+j
  18. 180 d=d+1:if d=nb then 240
  19. 190 if fl=0 then fl=1:print "";:goto 210
  20. 200 fl=0:print "[159]";
  21. 210 for u=1 to int(200*rnd(1))+20:get b$:if b$<>" " then next:goto 110
  22. 220 if b$=" " then print "too soon!
  23. 230 d[178]0:tl[178]0:fl[178]1:[137] 70
  24. 240 av[178]tl[173]d:av[178][181](av[172]100[170].5)[173]100
  25. 250 [153] "average reaction time ="av"sec."
  26. 260 [139] av[179]bt [167] [153] "best time ="av"sec.":bt[178]av:[137] 230
  27. 270 [153] "best time ="bt"sec."
  28. 280 [137] 230
  29.